package com.mcflywzx.airhockey.objects;

import java.util.List;

import com.mcflywzx.airhockey.data.VertexArray;
import com.mcflywzx.airhockey.objects.ObjectBuilder.DrawCommand;
import com.mcflywzx.airhockey.objects.ObjectBuilder.GeneratedData;
import com.mcflywzx.airhockey.programs.ColorShaderProgram;
import com.mcflywzx.airhockey.util.Geometry.Cube;
import com.mcflywzx.airhockey.util.Geometry.Cylinder;
import com.mcflywzx.airhockey.util.Geometry.Point;
import com.mcflywzx.airhockey.util.Geometry.*;
import com.mcflywzx.airhockey.util.*;
import com.mcflywzx.airhockey.programs.*;
import android.content.*;
import com.mcflywzx.airhockey.*;

public class MCube extends Cube {

	public Point position;
	
	private MatrixHelper mh;
	
	public MSquare[] s = new MSquare[6];

	public MCube(Point position, float L, float W, float H, MatrixHelper mh, TextureShaderProgram tsp, Context co) {
		super(position, L, W, H);
		this.position = position;
	    this.mh = mh;
		
		Vector[] color = new Vector[]{
			new Vector(1f, 0f, 0f), 
			new Vector(0f, 1f, 0f),
			new Vector(1f, 0f, 1f),
			new Vector(0f, 0f, 1f),
			new Vector(1f, 1f, 0f),
			new Vector(0f, 0f, 0f)};

	
		s[0] = new MSquare(new Point(0f, 0f, 0f), W, L, tsp, co, R.drawable.b_glass_down, true);
		s[1] = new MSquare(new Point(0f, 0f, 0f), W, L, tsp, co, R.drawable.b_glass_up, true);
		s[2] = new MSquare(new Point(0f, 0f, 0f), L, H, tsp, co, R.drawable.b_glass_around, true);
		s[3] = new MSquare(new Point(0f, 0f, 0f), L, H, tsp, co, R.drawable.b_glass_around, true);
		s[4] = new MSquare(new Point(0f, 0f, 0f), W, H, tsp, co, R.drawable.b_glass_around, true);
		s[5] = new MSquare(new Point(0f, 0f, 0f), W, H, tsp, co, R.drawable.b_glass_around, true);
					
			
			
		
		
	}
	
	public void addVector(Vector v) {
		position.x += v.x;
		position.y += v.y;
		position.z += v.z;
	}
	
	public void draw() {
		mh.PositionAndRotateCubeInScene(this);
	}
}
